package com.nervenets.general.web.params;

import com.nervenets.general.hibernate.DomainObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.Max;
import javax.validation.constraints.PositiveOrZero;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public abstract class EntityPagingParams<T extends DomainObject> extends QueryParams<T> {
    @ApiModelProperty(value = "页码", required = true)
    @PositiveOrZero
    private int page;
    @ApiModelProperty(value = "每页数量", required = true)
    @PositiveOrZero
    @Max(value = 250)
    @Builder.Default
    private int limit = 20;
}
